﻿<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <meta charset="utf-8" />
    <!--引入插件-->
    <script type="text/javascript" src="avalidate-v2.0.0 beta.js"></script>
</head>
<body>
    <form class="frm">
        <select data-rule="*" name="xinqu">
            <option value="">请选择</option>
            <option value="篮球">篮球</option>
            <option value="足球">足球</option>
            <option value="羽毛球">羽毛球</option>
        </select>
        <input type="radio" name="gender2" value="男" data-rule="*" data-errmsg="请选择性别" /> 男
        <input type="radio" name="gender2" value="女" /> 女

        <input type="checkbox" name="gender" value="男" data-rule="*2-3" /> 男
        <input type="checkbox" name="gender" value="女" /> 女
        <input type="checkbox" name="gender" value="人妖" /> 人妖
        <input type="checkbox" name="gender" value="不限" /> 不限
        <div>
            姓名：   <input type="text" name="xm1" data-rule="*2-6" data-nullmsg="必填" data-errmsg="2到6个字符" data-sucmsg="" data-ignore="true" />
        </div>
        <div>
            姓名2：   <input type="number" name="xm2" data-rule="*" data-nullmsg="姓名不能为空" data-errmsg="必须是3到6个字符" data-sucmsg="" data-haved="true" />
        </div>
        <br />
        <br />
        <input type="button" class="btn" value="提交" />
    </form>
    <br />
    <hr />
    <br />
    <script type="text/javascript">
        V.init({
            area: ".frm",
            btn: ".btn",
            before: function (form) {
            },
            success: function (form, formData) {
                alert("验证成功了");
                console.log(formData);
            },
            error: function (form, errorElement, status) { },
            complete: function (form, status) {
            }
        });
    </script>
</body>
</html>
